<!--#include file="./doctype.html"-->
<title>留言管理-<%=siteTitle%>-后台管理</title>
</head><body>
<div class="wrap">
    <ol class="breadcrumb">
        <li class="active"><a href="<%=fileName%>">列表首页</a></li>
    </ol>
    <form method="get" action="<%=fileName%>" class="mb10" role="form">
        <input type="hidden" value="index" name="q">
        <!--<input type="hidden" value="2" name="genreID" id="genreID">-->
        <div class="form-group dn">
            <label class="inline control-label" for="genreID">大类选择</label>
            <div class="inline w20 genre_id" data-name="genreID" data-id="2"></div>
        </div>
        <div class="form-group">
            <label class="inline control-label" for="classID">栏目筛选</label>
            <div class="inline w20 class_id" data-name="classID" data-id="<%=classID%>"></div>
        </div>
        <div class="form-group">
            <label for="keyword">搜索标题、内容：</label>
            <input type="text" class="form-control inline w20 input-sm clean" id="keyword" name="keyword" value="<%=app.hec(keyword)%>" placeholder="标题、内容关键字">
            <button type="submit" class="btn btn-sm btn-primary">确定</button>
        </div>
    </form>
    <% if isArray(data) then
        dim reTotal
        for i = 0 to ubound(data, 2)
            Tid = data(0,i)
            reTotal = conn.execute("select count(id) from cj_book where replyID=" & Tid)(0)
            className = ""
            dim classInfo
            classInfo = app.getClassInfo(data(12,i))
            if isArray(classInfo) then className = classInfo(2)
            %>
            <div class="book_list clearfix">
                <ul class="popover book_user clearfix">
                    <li class="clew" title="留言者:<%=data(1,i)%>">
                        <i class="glyphicon glyphicon-user"></i> <%=data(1,i)%>
                    </li>
                    <li title="留言时间:<%=app.cj_date(data(2,i))%>">
                        <i class="glyphicon glyphicon-time"></i> <%=app.cj_date(data(2,i))%>
                    </li>
                    <li title="IP:<%=data(3,i)%>,归属地:<%=data(4,i)%>">
                        <i class="glyphicon glyphicon-map-marker"></i>
                        <%=data(3,i)%>,归属地 <%=data(4,i)%>
                    </li>
                    <li title="email:<%=data(5,i)%>">
                        <i class="glyphicon glyphicon-envelope"></i> <%=data(5,i)%>
                    </li>
                    <li title="会员编辑码:<%=data(6,i)%>">
                        <i class="glyphicon glyphicon-edit"></i> <%=data(6,i)%>
                    </li>
                    <li>
                        审核<span class="setBool" data-value="<%=data(7,i)%>"></span>
                        置顶<span class="setBool" data-value="<%=data(8,i)%>"></span>
                        公开<span class="setBool" data-value="<%=data(9,i)%>"></span>
                        <label class="inline">
                            <input type="checkbox" name="batchId" value="<%=Tid%>" /> #<%=Tid%>
                        </label>
                        <a class="btn btn-xs pull-right clew" href="<%=fileName%>?q=edit&id=<%=Tid%>" title="修改">
                            <i class="glyphicon glyphicon-pencil"></i>
                        </a>
                    </li>
                </ul>
                <div class="popover right">
                    <div class="arrow"></div>
                    <h3 class="popover-title clearfix">
                        <span class="pull-left mr10"><%=className%></span>
                        <a class="pull-left clew book_title" href="<%=fileName%>?q=detail&id=<%=Tid%>" title="查看详细">
                            <%=app.hec(data(10,i))%>
                        </a>
                        <span class="badge pull-right clew" title="点击数"><%=data(13,i)%></span>
                        <span class="badge pull-right clew" title="回复数"><%=reTotal%></span>
                    </h3>
                    <div class="popover-content clearfix book_content_box">
                        <div class="book_content"><%=data(11,i)%></div>
                        <span class="dn btn btn-xs btn-default show_all">展开</span>
                    </div>
                </div>
            </div>
        <% next %>
        <!--#include file="page.html"-->
        <div class="btn-group">
            <span class="btn btn-sm btn-default selectAll">
                <i class="glyphicon glyphicon-th"></i> 全选/反选
            </span>
            <span class="btn btn-sm btn-default deleteBatch">
                <i class="glyphicon glyphicon-trash"></i> 删除
            </span>
            <span class="btn btn-sm btn-default statusBatch" data-status="1" data-name="auditing">
                <i class="glyphicon glyphicon-ok"></i> 审核
            </span>
            <span class="btn btn-sm btn-default statusBatch" data-status="0" data-name="auditing">
                <i class="glyphicon glyphicon-minus-sign"></i> 取消审核
            </span>
            <span class="btn btn-sm btn-default statusBatch" data-status="1" data-name="isTop">
                <i class="glyphicon glyphicon-arrow-up"></i> 置顶
            </span>
            <span class="btn btn-sm btn-default statusBatch" data-status="0" data-name="isTop">
                <i class="glyphicon glyphicon-arrow-down"></i> 取消置顶
            </span>
            <span class="btn btn-sm btn-default editBatch">
                <i class="glyphicon glyphicon-edit"></i> 修改
            </span>
        </div>
    <% else %>
        <!--#include file="noData.html"-->
    <% End if %>
    <!--#include file="loadTime.html"-->
</div>
<script>
$(document).ready(function(){
    var getData = function(id) {
        var gid = id || $('#genreID').val();
        $('.class_id').getKind({
            url: './ajax.asp?q=getGenreClass',
            data:'id='+gid
        });
    },
    content_height = 130;
    $('.genre_id').getKind({
        url: './ajax.asp?q=getGenreType',
        data:'id=2',
        type: 'select',
        callback: function(a) {
            getData($(this).find('select').val())
        }
    });
    $('.setBool').setBool(1);
    $('.book_content').each(function() {
        if(this.scrollHeight > content_height) {
            $(this).next('.show_all').removeClass('dn');
        }
    });
    $('.clew').each(function() {
        $(this).attr({
             'data-toggle': 'tooltip',
             'data-placement': 'top'
        });
    }).tooltip();
$(this)
    .on('change', '.genre_id select', function() {
        getData($(this).val());
    })
    .on('click', '.show_all', function() {
        !this.total && (this.total = 0);
        this.total++;
        var self = $(this), box = self.parents('.book_content_box');
        if(this.total % 2 != 0){
            self.html('收起');
            box.stop(true, true).animate({
                height: self.siblings('.book_content').height()
            }, 300, function() {
                $(this).height('auto');
            });
        } else {
            self.html('展开');
            box.stop(true, true).animate({height: content_height}, 300);
        }
    })
    .on('click', '.statusBatch', function() {
        $(this).statusBatch();
    })
    .on('click', '.deleteBatch', function() {
        $.deleteBatch({
            msg: '删除主题同时会删除该主题的所有回复！确定？'
        });
    })
    .on('click', '.editBatch', function() {
        $.editBatch();
    })
});
</script>
</body>
</html>